<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

Route::get('/', 'HomeController@index');

Auth::routes();

Route::get('/home', 'HomeController@index');

Route::get('/transexcel', 'TransController@import');

Route::group(['prefix' => 'admin','namespace' => 'Admin','middleware' => ['auth']],function ($router)
{
    $router->get('/dash','DashboardController@index')->name('system.index');
    $router->get('/i18n', 'DashboardController@dataTableI18n');
    // 权限
    require(__DIR__ . '/admin/permission.php');
    // 角色
    require(__DIR__ . '/admin/role.php');
    // 用户
    require(__DIR__ . '/admin/user.php');
    // 菜单
    require(__DIR__ . '/admin/menu.php');
    // 应用管理
    require(__DIR__ . '/admin/application.php');
    // 翻译项目
    require(__DIR__ . '/admin/project.php');
    // 多语言
    require(__DIR__ . '/admin/language.php');
    // 开始翻译
    require(__DIR__ . '/admin/translate.php');
});

// 后台系统日志
Route::group(['prefix' => 'admin/log','middleware' => ['auth','check.permission:log']],function ($router)
{
    $router->get('/','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@index')->name('log.dash');
    $router->get('list','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@listLogs')->name('log.index');
    $router->post('delete','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@delete')->name('log.destroy');
    $router->get('/{date}/all','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@show')->name('log.all');
    $router->get('/{date}','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@show')->name('log.show');
    $router->get('/{date}/download','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@download')->name('log.download');
    $router->get('/{date}/{level}','\Arcanedev\LogViewer\Http\Controllers\LogViewerController@showByLevel')->name('log.filter');
});